package com.atguigu.tingshu.album.client.impl;


import com.atguigu.tingshu.album.client.CategoryFeignClient;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.BaseCategory1;
import com.atguigu.tingshu.model.album.BaseCategory3;
import com.atguigu.tingshu.model.album.BaseCategoryView;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class CategoryDegradeFeignClient implements CategoryFeignClient {


    @Override
    public Result<List<BaseCategory1>> findAllCategory1() {
        return null;
    }

    /**
     * 根据分类编号查询分类视图数据
     * @param category3Id
     * @return
     */
    @Override
    public Result<BaseCategoryView> getCategoryView(Long category3Id) {
        log.error("熔断...");
        BaseCategoryView baseCategoryView = new BaseCategoryView();
        baseCategoryView.setId(10L);
        baseCategoryView.setCategory3Name("熔断");
        return Result.ok(baseCategoryView);
    }

    @Override
    public Result<List<BaseCategory3>> findTopBaseCategory3(Long category1Id) {
        log.error("获取List<BaseCategory3>失败...");
        return Result.fail();
    }
}
